home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 2
/
Gold Medal Software Volume 2 (Gold Medal) (1994).iso
/
prog
/
bozol2.arj
/
FLOW.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-10-25
|
1KB
|
38 lines
CASE "GOTO"
' if it's a number goto the literal line number otherwise
' try to find a label matching the name of what was pushed.
A$=POPARG$
IF VAL(A$) THEN
ProgLine%=VAL(A$)-1
ELSE
ARRAY SCAN PROGRAM$(), FROM 1 TO LEN(LITERAL$(1)),_
COLLATE UCASE, =LITERAL$(1), TO ProgLine%
DECR ProgLine%
END IF
IF ProgLine%<1 OR ProgLine%>1000 THEN ERROR 100
CASE "TO", "IN", "WITH", "IS", "BE", "EQUAL", "OF", "THE", "AT"
' do nothing, these are spacers.
CASE "GOSUB"
INCR GosubPtr%
GosubStack%(GosubPtr%)=ProgLine%
A$=POPARG$
IF VAL(A$) THEN
ProgLine%=VAL(A$)-1
ELSE
ARRAY SCAN PROGRAM$(), FROM 1 TO LEN(LITERAL$(1)),_
COLLATE UCASE, =LITERAL$(1), TO ProgLine%
DECR ProgLine%
END IF
IF ProgLine%<1 OR ProgLine%>1000 THEN ERROR 100
CASE "RETURN"
ProgLine%=GosubStack%(GosubPtr%)
DECR GosubPtr%
IF ProgLine%=0 OR ProgLine%>1000 THEN ERROR 100